#ifndef _BSP_CAN_H_
#define _BSP_CAN_H_


#include "can.h"

//#define FEEDBACK_ID_BASE      0x200
//#define CAN_CONTROL_ID_BASE   0x1ff
//#define CAN_CONTROL_ID_EXTEND 0x2ff
//#define MOTOR_MAX_NUM         7

typedef struct
{
    uint16_t can_id;
    int16_t  set_voltage;
	int16_t  set_voltage2;
    int16_t  rotor_angle;
    int16_t  rotor_speed;
	int16_t  current;
	int8_t   temp;
	int16_t  last_angle;
	int16_t  motor_angle_eer;
	float  	 total_angle;
	int16_t  out_real_angle;
	int16_t  out_angle;
	int16_t  count;
	int16_t  length;
	int16_t  round_cnt;
	int16_t	 offset_angle;
	int16_t  angle_360_offset;
	int16_t  angle_360;
}moto_info_t;

void can_user_init(CAN_HandleTypeDef* hcan );
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0MsgPendingCallback1(CAN_HandleTypeDef *hcan);
void  bsp_cancurrent(uint16_t speed);   // ,uint16_t speed2,uint16_t speed3,uint16_t speed4);
void CAN_cmd_chassis_reset_ID(void);
void update_angle(moto_info_t* moto);
#endif
